(function($) {
	var $form = $(&#39;#ajax-search-form&#39;),
		$input = $form.find(&#39;:text&#39;);
	$form.append(&#39;&lt;div id=&quot;search-result&quot;&gt;&lt;/div&gt;&#39;);
	var $result_container = $(&#39;#search-result&#39;);
	$form.on(&quot;submit&quot;, function() {
		var keyword = $input.val();
		$result_container.show().html(&#39;Loading...&#39;);
		$.ajax({
			url: &#39;http://www.netzoone.com/feeds/posts/summary?alt=json-in-script&amp;q=&#39; + keyword + &#39;&amp;max-results=9999&#39;,
			type: &#39;get&#39;,
			dataType: &#39;jsonp&#39;,
			success: function(json) {
				var entry = json.feed.entry,
					link, skeleton = &quot;&quot;;
				if (entry !== undefined) {
					skeleton = &#39;&lt;h4&gt;Search results for &amp;quot;&#39; + keyword + &#39;&amp;quot;&lt;/h4&gt;&#39;;
					skeleton += &#39;&lt;a class=&quot;close&quot; href=&quot;/&quot;&gt;&amp;times;&lt;/a&gt;&lt;ol&gt;&#39;;
					for (var i = 0; i &lt; entry.length; i++) {
						for (var j = 0; j &lt; entry[i].link.length; j++) {
							if (entry[i].link[j].rel == &quot;alternate&quot;) {
								link = entry[i].link[j].href;
							}
						}
						skeleton += &#39;&lt;li&gt;&lt;a href=&quot;&#39; + link + &#39;&quot;&gt;&#39; + entry[i].title.$t + &#39;&lt;/a&gt;&lt;/li&gt;&#39;;
					}
					skeleton += &#39;&lt;/ol&gt;&#39;;
					$result_container.html(skeleton);
				} else {
					$result_container.html(&#39;&lt;a class=&quot;close&quot; href=&quot;/&quot;&gt;&amp;times;&lt;/a&gt;&lt;strong&gt;No result found!&lt;/strong&gt;&#39;);
				}
			},
			error: function() {
				$result_container.html(&#39;&lt;a class=&quot;close&quot; href=&quot;/&quot;&gt;&amp;times;&lt;/a&gt;&lt;strong&gt;Error loading feed.&lt;/strong&gt;&#39;);
			}
		});
		return false;
	});
	$form.on(&quot;click&quot;, &quot;.close&quot;, function() {
		$result_container.fadeOut();
		return false;
	});
})(jQuery);